package com.woniuxy.ticket.ticketmovie.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.woniuxy.ticket.ticketmovie.groups.TypeUpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@TableName("ticket_type")
public class Type implements Serializable {

    private static final long serialVersionUID = 4580774108797825838L;

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "id不能为空",groups = TypeUpdateGroup.class)
    private Integer id;

    //类型名
    @NotNull(message = "类型名称不能为空")
    @Length(min = 2,max = 5,message = "类型长度必须在{min}-{max}之间")
    private String name;
}
